package org.collection.newcollection;

import com.google.common.collect.Range;
import com.google.common.collect.RangeMap;
import com.google.common.collect.TreeRangeMap;

public class RangeMapTest {

	public static void main(String[] args) {
		RangeMap<Integer, String> rangeMap = TreeRangeMap.create();
		rangeMap.put(Range.closed(1, 10), "foo");
		System.out.println(rangeMap);
		
		rangeMap.put(Range.open(3, 6), "bar");
		System.out.println(rangeMap);
		
		rangeMap.put(Range.open(10, 20), "foo");
		System.out.println(rangeMap);
		
		rangeMap.remove(Range.closed(5, 11));
		System.out.println(rangeMap);
	}
}
